# -*- coding: utf-8 -*-
# Created by huagnqiyin on 2016/9/6
import logging

from settings import config
from sanic_app import app

_logger = logging.getLogger()
_oplog = logging.getLogger("oplog")

# async def html(request, template_dir, html_file_name):
#     context = {}
#     context['username'] = request['session'].get("user")
#     return jinja.render('%s/%s.html' % (template_dir, html_file_name), request, **context)
#
#
# app.add_route(html, "<template_dir>/<html_file_name>.html$", methods=['GET'])

app.static('/asset', './templates')

app.config.update(config)
if __name__ == '__main__':
    print("start main")
    app.run(port=8800,
            debug=False,
            workers=1,
            )
